import random


class Game:
    # 类属性
    top_score = 0

    @staticmethod  # 静态方法
    def show_help():
        print('这是帮助信息...xxx')

    def __init__(self, name):
        # 实例属性
        self.name = name

    @classmethod  # 类方法
    def show_top_score(cls):
        # print('游戏最高分：', Game.top_score)
        print('游戏最高分：', cls.top_score)

    def start_game(self):  # 实例方法
        score = random.randint(10, 100)
        if score >= Game.top_score:
            Game.top_score = score
        else:
            print(self.name, '的本次分数是：', score, ',再接再厉吧')
        print(self.name, '的本次分数是：', score)


xwGame = Game('小王')
print(xwGame.__dict__)

xwGame.start_game()
xwGame.show_top_score()
xwGame.start_game()
xwGame.show_top_score()
xwGame.start_game()
xwGame.show_top_score()

print('__name__:', __name__)

if __name__ == '__main__':
    pass